import 'package:flutter/material.dart';

///作者：范玉辉
///创建时间：2021/8/17
///说明：


///作者：范玉辉
///创建时间：2020/12/28
///说明：登录返回实体
///
class UserLoginEntity {
  String? avatar;
  String? accessToken;
  int? appClientType;
  int? appId;
  bool? certifyStatus;
  int? companyId;
  String? employeeJpushId;
  int? id;
  String? name;
  String? phone;
  List<RoleVOList>? roleVOList;
  String? userSign;
  int? sex;
  String? tid;
  String? jpushId;
  String? account;
  String? address;
  int? cityId;
  bool? deleted;
  String? description;
  int? provinceId;
  String? refreshToken;
  int? userType = 1;
  String? bgImage; // 2121.5.24新增

  UserLoginEntity({
    this.accessToken,
    this.address,
    this.appClientType,
    this.appId,
    this.avatar,
    this.cityId,
    this.companyId,
    this.deleted,
    this.description,
    this.employeeJpushId,
    this.certifyStatus,
    this.id,
    this.jpushId,
    this.name,
    this.phone,
    this.provinceId,
    this.refreshToken,
    this.roleVOList,
    this.sex,
    this.tid,
    this.userSign,
    this.userType,
    this.bgImage,
  });

  UserLoginEntity.fromJson(Map<String, dynamic> json) {
    accessToken = json['accessToken'];
    address = json['address'];
    appClientType = json['appClientType'];
    appId = json['appId'];
    avatar = json['avatar'];
    cityId = json['cityId'];
    companyId = json['companyId'];
    deleted = json['deleted'];
    description = json['description'];
    employeeJpushId = json['employeeJpushId'];
    certifyStatus = json['certifyStatus'];
    id = json['id'];
    jpushId = json['jpushId'];
    account = json['account'];
    name = json['name'];
    phone = json['phone'];
    provinceId = json['provinceId'];
    refreshToken = json['refreshToken'];
    if (json['roleVOList'] != null) {
      roleVOList = <RoleVOList>[];
      json['roleVOList'].forEach((v) {
        roleVOList!.add(new RoleVOList.fromJson(v));
      });
    }
    sex = json['sex'];
    tid = json['tid'];
    userSign = json['userSign'];
    userType = json['userType'];
    bgImage = json['bgImage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['accessToken'] = this.accessToken;
    data['address'] = this.address;
    data['appClientType'] = this.appClientType;
    data['appId'] = this.appId;
    data['avatar'] = this.avatar;
    data['cityId'] = this.cityId;
    data['companyId'] = this.companyId;
    data['deleted'] = this.deleted;
    data['description'] = this.description;
    data['employeeJpushId'] = this.employeeJpushId;
    data['certifyStatus'] = this.certifyStatus;
    data['id'] = this.id;
    data['jpushId'] = this.jpushId;
    data['account'] = this.account;
    data['name'] = this.name;
    data['phone'] = this.phone;
    data['provinceId'] = this.provinceId;
    data['refreshToken'] = this.refreshToken;
    if (this.roleVOList != null) {
      data['roleVOList'] = this.roleVOList!.map((v) => v.toJson()).toList();
    }
    data['sex'] = this.sex;
    data['tid'] = this.tid;
    data['userSign'] = this.userSign;
    data['userType'] = this.userType;
    data['bgImage'] = this.bgImage;
    return data;
  }
}

class RoleVOList {
  int? acceptStatus;
  int? id;
  String ?name;
  int? type;

  RoleVOList({this.acceptStatus, this.id, this.name, this.type});

  RoleVOList.fromJson(Map<String, dynamic> json) {
    acceptStatus = json['acceptStatus'];
    id = json['id'];
    name = json['name'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['acceptStatus'] = this.acceptStatus;
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    return data;
  }
}
